<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

        *{
            margin: 0;
            padding: 0;
        }

        html,body{
            height: 100%;
        }

        .box{
            width: 100%;
            height: 100%;
            display: flex;
            /* 横向纵向都可以 */
            flex-direction: column;
        }

        .box div:nth-child(1){
            height: 100px;
            background: red;
        }
        .box div:nth-child(2){
            background: rebeccapurple;
            flex: 1;

        }
        .box div:nth-child(3){
            height: 100px;
            background: red;
        }



    </style>

</head>
<body>

    <div class="box">
       
        <div></div>
        <div></div>
        <div></div>

    </div>
    
</body>
</html>